package com.frikinet.gestorepub.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.NotPersistent;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Link;
import com.google.appengine.api.datastore.Text;

@SuppressWarnings("serial")
@PersistenceCapable
public class Book implements Serializable
{
	@PrimaryKey
	@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
	private Long id;
	
	public enum Status { NONE, SOON, ERRORS, REVISED; }
	@Persistent
	private Status status;
	
	@Persistent
	private List<Long> authorKeys = new ArrayList<Long>();
	
	@NotPersistent
	private List<Author> authors = new ArrayList<Author>();
	
	@Persistent
	private List<Long> categoryKeys = new ArrayList<Long>();
	
	@NotPersistent
	private List<Category> categories = new ArrayList<Category>();
	
	@Persistent
	private Long serieKey;
	
	@NotPersistent
	private Serie serie;
	
	@Persistent
	private Integer serieIndex;
	
	@Persistent
	private Long editorKey;
	
	@NotPersistent
	private Editor editor;
	
	@Persistent
	private String title;
	
	@Persistent
	private Link cover;
	
	@Persistent
	private Text link;
	
	@Persistent
	private Integer majorVersion;
	
	@Persistent
	private Integer minorVersion;
	
	@Persistent
	private Integer pages;
	
	@Persistent
	private Date publicationDate;
	
	@Persistent
	private Date modificationDate;
	
	@Persistent
	private Date updateDate;
	
	@Persistent
	private Text synopsis;
	
	@Persistent
	private Text notes;

	public Long getId()
	{
		return id;
	}

	public void setId(Long id)
	{
		this.id = id;
	}

	public Status getStatus()
	{
		return status;
	}

	public void setStatus(Status status)
	{
		this.status = status;
	}

	public List<Long> getAuthorKeys()
	{
		return authorKeys;
	}

	public void setAuthorKeys(List<Long> authorKeys)
	{
		this.authorKeys = authorKeys;
	}

	public List<Author> getAuthors()
	{
		return authors;
	}

	public void setAuthors(List<Author> authors)
	{
		this.authors = authors;
	}

	public List<Long> getCategoryKeys()
	{
		return categoryKeys;
	}

	public void setCategoryKeys(List<Long> categoryKeys)
	{
		this.categoryKeys = categoryKeys;
	}

	public List<Category> getCategories()
	{
		return categories;
	}

	public void setCategories(List<Category> categories)
	{
		this.categories = categories;
	}

	public Long getSerieKey()
	{
		return serieKey;
	}

	public void setSerieKey(Long serieKey)
	{
		this.serieKey = serieKey;
	}

	public Serie getSerie()
	{
		return serie;
	}

	public void setSerie(Serie serie)
	{
		this.serie = serie;
	}

	public Integer getSerieIndex()
	{
		return serieIndex;
	}

	public void setSerieIndex(Integer serieIndex)
	{
		this.serieIndex = serieIndex;
	}

	public Long getEditorKey()
	{
		return editorKey;
	}

	public void setEditorKey(Long editorKey)
	{
		this.editorKey = editorKey;
	}

	public Editor getEditor()
	{
		return editor;
	}

	public void setEditor(Editor editor)
	{
		this.editor = editor;
	}

	public String getTitle()
	{
		return title;
	}

	public void setTitle(String title)
	{
		this.title = title;
	}

	public Link getCover()
	{
		return cover;
	}

	public void setCover(Link cover)
	{
		this.cover = cover;
	}

	public Text getLink()
	{
		return link;
	}

	public void setLink(Text link)
	{
		this.link = link;
	}
	
	public Integer getMajorVersion()
	{
		return majorVersion;
	}

	public void setMajorVersion(Integer majorVersion)
	{
		this.majorVersion = majorVersion;
	}

	public Integer getMinorVersion()
	{
		return minorVersion;
	}

	public void setMinorVersion(Integer minorVersion)
	{
		this.minorVersion = minorVersion;
	}

	public Integer getPages()
	{
		return pages;
	}

	public void setPages(Integer pages)
	{
		this.pages = pages;
	}

	public Date getPublicationDate()
	{
		return publicationDate;
	}

	public void setPublicationDate(Date publicationDate)
	{
		this.publicationDate = publicationDate;
	}

	public Date getModificationDate()
	{
		return modificationDate;
	}

	public void setModificationDate(Date modificationDate)
	{
		this.modificationDate = modificationDate;
	}

	public Date getUpdateDate()
	{
		return updateDate;
	}

	public void setUpdateDate(Date updateDate)
	{
		this.updateDate = updateDate;
	}

	public Text getSynopsis()
	{
		return synopsis;
	}

	public void setSynopsis(Text synopsis)
	{
		this.synopsis = synopsis;
	}

	public Text getNotes()
	{
		return notes;
	}

	public void setNotes(Text notes)
	{
		this.notes = notes;
	}
}
